#ifndef TIMER_H
#define TIMER_H

#include <SDL.h>
#include "Singleton.h"
#include "rapidxml.hpp"

namespace Engine
{
	//works out the delta time between calls to update
	class Timer : public NonCopyable
	{
	private:
		friend class Singleton <Timer>;
		float m_dt;//delta time
		float m_dtCap;
		unsigned int m_oldTicks;
		bool m_paused;
		Timer();

	public:
		bool Initialize(float dtCap);
		bool Initialize(rapidxml::xml_node <>* node);
		void Pause();
		bool IsPaused() const;
		void Unpause();
		void Update();
		float GetDT() const;
	};

	typedef Singleton <Timer> TheTimer;
}

#endif